package com.btpn.custody.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/*
 * Tracing Log Region, Area, Branch
 * Tracing Log SLA changes
 * Tracing Log User
 * Tracing Log Upload to EQ
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert=true, dynamicUpdate=true)
@Table(name = "TL_GLOBAL")
public class TL_GLOBAL implements Serializable {

	private static final long serialVersionUID = 3426009696854725634L;

	public static final String GROUP_1 = "1";
	public static final String GROUP_2 = "2";
	public static final String GROUP_3 = "3";
	public static final String GROUP_4 = "4";
	
	@Id 
	@GeneratedValue
	@Column(name = "ID")
	private Long id;
	
	@Column(name = "CLASS")
	private String actionClass;
	
	@Column(name = "ACTION", columnDefinition="VARCHAR(1)")
	private String action;
	
	/*
	 * 1	: Region, Area, Branch
	 * 2	: Parameter SLA
	 * 3	: User
	 * 4	: Upload EQ
	 */
	@Column(name = "ACTION_GROUP", columnDefinition="VARCHAR(2)")
	private String group;
	
	@Column(name = "ACTION_DATE")
	private Date actionDate = new Date();
	
	@Column(name = "ACTION_USER", columnDefinition="VARCHAR(100)")
	private String user;

	@Column(name = "NOTE")
	private String note;
	
	public TL_GLOBAL() {
		super();
	}

	public TL_GLOBAL(String actionClass, String action, String group, String user, String note) {
		super();							// GLOBAL						|	SLA						| User					| Upload EQ
		this.actionClass = actionClass;		// com.ryan.entity.Region		|							| User					| 
		this.action = action;				// CUD							|	CUD						| CUD					| 
		this.group = group;					// 1							|	2						| 3						| 4
		this.user = user;					// (branch) - username			|	(branch) - username		| (branch) - username	| (branch) - username
		this.note = note;					// regionId						|	(U)SLA days from 3 to 1	| (U)area changes		| 
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getActionClass() {
		return actionClass;
	}

	public void setActionClass(String actionClass) {
		this.actionClass = actionClass;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public Date getActionDate() {
		return actionDate;
	}

	public void setActionDate(Date actionDate) {
		this.actionDate = actionDate;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}
}
